TestConnectionString Method

Syntax

TestConnectionString as L (ldapConnectionString as C, userId as C, password as C)

Arguments

ldapConnectionStringCharacter

The LDAP(S) connection string to test connecting to the Active Directory domain.

userIdCharacter

The user id/name of a user allowed to connect to the Active Directory domain.

passwordCharacter

The password for the userId.

Returns

resultCallResult

Use the returned CallResult to see if the method succeeds.

Description

Test an LDAP(S) connection string can connect to an Active Directory domain. This is a static method and can be called without creating a WindowsServices::ActiveDirectory::Domain object.

dim valid as L = .F.
dim ldapConnectionString as c = "LDAPS://dc012019.internal.acme.com/CN=Users,DC=internal,DC=acme,DC=com"
dim userId as c = "JohnDoe"
dim password as c = "secret"

dim cr as CallResult
cr = WindowsServices::ActiveDirectory::Domain::TestConnectionString(ldapConnectionString, userId, password)
if .not. cr.Success then
	?"Failed to connect using the connection string: " + ldapConnectionString + " error is " + domain.CallResult.Text + crlf()
	goto exitTestFunction
end if
	
?"The connection string works." + crlf()
	
exitTestFunction: